1. Field of the Invention
The present invention relates to an image measuring apparatus and a computer program that allow measurement results to be displayed such that the measurement results are easily visible without depending on a state where a measurement object is mounted.
2. Description of the Related Art
As an apparatus for measuring a shape of a measurement object, a number of image measuring apparatuses have been developed. Such an image apparatus applies light to a measurement object, acquires an image by image formation of transmitted light or reflected light of the applied light on an imaging device, such as a CCD (charge coupled device) and CMOS (complementary metal-oxide semiconductor), through a light receiving lens, and performs computing of the acquired image, thereby measuring the shape of the measurement object.
The image of a measurement object becomes extremely accurately similar to the measurement object with the aid of a light receiving lens. By calibrating the dimensions of the image by using a magnification of the light receiving lens, the dimensions of an actual measurement object can be measured based on the dimensions of the image. Accordingly, accurately identifying the shape of a measurement object appearing on an image enables the shape of an actual measurement object to be accurately measured. The shape of a measurement object on an image is identified by detecting the boundary portion (hereinafter referred to as an “edge portion”) between the measurement object and the background image on the image. FIG. 17 shows an example of a conventional edge detection area specified on an image. FIG. 18 shows an example of a shape identified by using a method of least squares based on conventional edge points. FIG. 19 is a schematic view for illustrating a circle obtained by fitting conventional edge points to a geometrical figure.
When detecting edges on an image, a periphery of an edge portion is surrounded by clicking or dragging it with a pointing device, such as a mouse, to specify an edge detection area as shown in FIG. 17. The edge portion is a part with a sharp change in luminance value between the pixel of a measurement object and the pixel of a background image. A computer acquires, for example, a part (between pixels) with a luminance difference between adjacent pixels larger than a predetermined value in image data in the specified area, as a plurality of edge points shown in FIG. 17. The plurality of acquired edge points are fitted to a geometrical figure, such as a straight line, by using a regression analysis method, such as a method of least squares, as shown in FIG. 18. For example, the straight line to which the edge points are fitted is detected as an edge. Even if points constitute a straight line, the points can be detected likewise. For a circular shape, like a straight line, a part with a sharp change in luminance value positioned between adjacent pixels is acquired as a plurality of edge points, and the plurality of acquired edge points are fitted to a geometrical figure by using a method of least squares or the like. For example, a circle to which the edge points are fitted can be detected as an edge as shown in FIG. 19.
A size of a measurement object itself and a size of a measurement object part are various. Accordingly, if a measurement object having a hand-held size (size from several millimeters to about 100 mm square) is measured with a measuring device having the field of view of only a few millimeters square, the entire image of a measurement object cannot be collectively grasped. In this case, for example, an XY stage and the like are moved to relatively move a measurement object with respect to the field of view, so that a necessary portion is within the field of view, and thereafter measurement is performed, which is disclosed in Japanese Unexamined Patent Publication No. 11-132740.
For example, when the distance between two straight lines that are not within the same field of view is measured, first, one straight line edge is specified, and then an XY stage is moved and the other straight line edge is specified. The distance between the specified straight line edges is measured by calculating from the position in the displayed image and the movement amount of the XY stage.
It is difficult in the image measuring apparatus to grasp what measured value of what part of the measurement object is represented by the measurement result. Conventionally, for example as disclosed in Japanese Unexamined Patent Publication No. 11-132740, an image of a measurement object is displayed on a display screen, and dimension lines in accordance with measurement places specified for measurement of geometrical dimensions are also displayed. In this manner, a user can easily confirm the measurement result with the displayed geometrical dimensions.
In conventional image measuring apparatuses including Japanese Unexamined Patent Publication No. 11-132740, if a measurement object is within the field of view, a user can easily grasp what measured value of what part of the measurement object is represented by the measurement result. However, if the measurement object is not within the field of view, the entire image of the measurement object cannot be displayed. This makes it difficult to grasp what part of the measurement object is represented by a measured value and how the part is measured for obtaining the measured value. Therefore, there has been a problem that it is difficult for a user to intuitively grasp a measured portion.
For example, there is an apparatus in which a detected edge portion is displayed on a screen other than that for a measurement object, so that dimension lines and a measurement result are displayed on individual screens. However, the entire image of a measurement object cannot be displayed, which is the same as other conventional image measuring apparatuses. This apparatus is not different from other conventional image measuring apparatuses in that it is difficult to grasp what part of a measurement object is represented by a measured value and how the part is measured for obtaining the measured value if the shape of the measurement object is complicated.